<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>公告-目的地运营集团数据管理平台</title>
<include file="Include:style" />
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">公告</div>
		<if condition="((get_permission('GG',NULL,3)) and ($vo['add_uid'] eq $login_id)) or (get_permission('GG',NULL,1))">
		<div class="right">
			<a class="btn" href="__APP__/System/notice_list_add">添加公告</a>
		</div>
		</if>
	</div>
	<div id="content">
		<div class="filter">
			<div class="filter-item">
				<div class="filter-title">分类：</div>
				<ul class="filter-order">
					<li <if condition="$type eq -10">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/-10">全部</a>
					</li>
					<li <if condition="$type eq 1">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/1">项目制度</a>
					</li>
					<li <if condition="$type eq 2">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/2">公司制度</a>
					</li>
					<li <if condition="$type eq 3">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/3">信息发布</a>
					</li>
					<li <if condition="$type eq 4">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/4">通知</a>
					</li>
					<li <if condition="$type eq 5">class="current"</if>>
						<a href="__APP__/System/notice_list/tid/{$tid}/type/5">其它</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="table-scrollx">
			<table class="table table-bordered table-hover">
				<tr class="table-header fixed-table-header">
					<td>
						<select name="tid" class="form-control w500">
							<option value="-10" <if condition="-10 eq $tid">selected</if>>标题</option>
							<foreach name="titles" item="vo">
							<option value="{$vo['id']}" <if condition="$vo['id'] eq $tid">selected</if>>{$vo['title']}</option>
							</foreach>
						</select>
					</td>
					<td width="100">评论/回复</td>
					<td width="140">添加人(日期)</td>
					<if condition="((get_permission('GG',NULL,3)) and ($vo['add_uid'] eq $login_id)) or (get_permission('GG',NULL,1))">
					<td width="54">管理</td>
					</if>
				</tr>
				<if condition="$result eq NULL">
				<tr>
					<td <if condition="preg_match('/GG/',$login_permissions_rule)">colspan="4"<else />colspan="3"</if> class="text-center">暂无相关内容</td>
				</tr>
				</if>
				<foreach name="result" item="vo">
				<tr <if condition="$vo['first'] eq 1">class="notice_first"</if>>
					<td><a href="__APP__/System/notice_list_details/id/{$vo['id']}/tid/{$tid}/type/{$type}">{$vo['title']}</a></td>
					<td>{$vo['ask_count']}/{$vo['answer_count']}</td>
					<td>{$vo['add_user']}({$vo['add_date']|substr=0,10})</td>
					<if condition="((get_permission('GG',NULL,3)) and ($vo['add_uid'] eq $login_id)) or (get_permission('GG',NULL,1))">
					<td>
						<a href="__APP__/System/notice_list_edit/id/{$vo['id']}/tid/{$tid}/type/{$type}" data-toggle="tooltip" data-placement="left" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
						<a href="javascript:;" zid="{$vo['id']}" data-toggle="tooltip" data-placement="left" title="删除" class="delete ml5"><i class="glyphicon glyphicon-trash"></i></a>
					</td>
					</if>
				</tr>
				<if condition="$vo['first'] eq 1">
					<tr>
						<td class="notice_first" <if condition="preg_match('/GG/',$login_permissions_rule)">colspan="4"<else />colspan="3"</if>>
							<div class="notice_first_txt table-scrollx2">
								{$vo['content']}
							</div>
						</td>
					</tr>
				</if>
				</foreach>
			</table>
		</div>
		<div class="pages">{$page}</div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function() {
	//删除公告
	$(".delete").ajaxModal({"title_text":"确认提示框","body_text":"您确定要删除吗？","url":"__APP__/System/notice_list_delete","data":{"id":"zid"}});
		
	//标题
	$(document).on("change","[name='tid']",function(){
		var val = $(this).val();
		window.location.href="__APP__/System/notice_list/tid/"+val+"/type/{$type}";
	});
	//分类
	$(document).on("change","[name='type']",function(){
		var val = $(this).val();
		window.location.href="__APP__/System/notice_list/tid/{$tid}/type/"+val;
	});
	$('.table-scrollx2').niceScroll({
        cursorcolor:"#232f3f",
        cursorwidth:"8px",
		background:"#ddd",
		enablemousewheel:true
    });
});
</script>
</body>
</html>